package com.digital.welcome.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.digital.welcome.entity.College;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mapstruct.Mapper;
import org.springframework.stereotype.Repository;

/**
 * @author 韩
 */
@Mapper
@Repository
public interface CollegeMapper extends BaseMapper<College> {

    @Select("select * from college where college = #{college}")
    College selectByName(@Param("college") String college);

    @Select("insert into college(college, college_id) values (#{college}, #{collegeId})")
    void insertCollege(@Param("college") String college, @Param("collegeId") Integer collegeId);

    @Select("delete from college where college = #{college}")
    void deleteByCollege(@Param("college") String college);
}
